/*
Illuminator (LED drawing tool for iPhone)
Copyright (C) 2008
Nik S Denin
Ivan A Vlasov
Dmitriy A Jackovlev

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#import "ILToolbar.h"

@implementation ILToolbar

- (id)initWithFrame:(CGRect)frame withImage:(UIImage *)image
{
	if ((self = [super initWithFrame:frame]) != nil)
	{
		m_background = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, frame.size.width, frame.size.height)];
		[m_background setImage:image];
		[self addSubview:m_background];
		[self setAlpha:0.0];
	}
	return self;
}

- (void)show
{
	[m_delegate addSubview:self];
	[self setAlpha:1.0];
}

- (void)hide
{
	[self setAlpha:0.0];
	[self removeFromSuperview];
}

- (void)setDelegate:(id)delegate
{
	m_delegate = delegate;
}

- (void)dealloc
{
	[m_background release];
	[super dealloc];
}

@end
